package com.ruoyi.fpa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.util.SnowFlakeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fpa.mapper.FpaBizDefineMapper;
import com.ruoyi.fpa.domain.FpaBizDefine;
import com.ruoyi.fpa.service.IFpaBizDefineService;

/**
 * 业务功能Service业务层处理
 *
 * @author koradji@163.com
 * @date 2023-09-14
 */
@Service
public class FpaBizDefineServiceImpl implements IFpaBizDefineService
{
    @Autowired
    private FpaBizDefineMapper fpaBizDefineMapper;

    /**
     * 查询业务功能
     *
     * @param id 业务功能主键
     * @return 业务功能
     */
    @Override
    public FpaBizDefine selectFpaBizDefineById(String id)
    {
        return fpaBizDefineMapper.selectFpaBizDefineById(id);
    }

    /**
     * 查询业务功能列表
     *
     * @param fpaBizDefine 业务功能
     * @return 业务功能
     */
    @Override
    public List<FpaBizDefine> selectFpaBizDefineList(FpaBizDefine fpaBizDefine)
    {
        return fpaBizDefineMapper.selectFpaBizDefineList(fpaBizDefine);
    }

    /**
     * 新增业务功能
     *
     * @param fpaBizDefine 业务功能
     * @return 结果
     */
    @Override
    public int insertFpaBizDefine(FpaBizDefine fpaBizDefine)
    {
        if(StringUtils.isEmpty(fpaBizDefine.getId())) {
            fpaBizDefine.setId(String.valueOf(SnowFlakeUtils.snowFlakeId()));
        }
        return fpaBizDefineMapper.insertFpaBizDefine(fpaBizDefine);
    }

    /**
     * 修改业务功能
     *
     * @param fpaBizDefine 业务功能
     * @return 结果
     */
    @Override
    public int updateFpaBizDefine(FpaBizDefine fpaBizDefine)
    {
        return fpaBizDefineMapper.updateFpaBizDefine(fpaBizDefine);
    }

    /**
     * 批量删除业务功能
     *
     * @param ids 需要删除的业务功能主键
     * @return 结果
     */
    @Override
    public int deleteFpaBizDefineByIds(String[] ids)
    {
        return fpaBizDefineMapper.deleteFpaBizDefineByIds(ids);
    }

    /**
     * 删除业务功能信息
     *
     * @param id 业务功能主键
     * @return 结果
     */
    @Override
    public int deleteFpaBizDefineById(String id)
    {
        return fpaBizDefineMapper.deleteFpaBizDefineById(id);
    }
}
